<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <title>AudioVideoAPI</title>
</head>
<body>
  <video id="movies"   autoplay="autoplay" controls="controls"  autobuffer="true" width="400px" height="300px">
    <source src="Intermission-Walk-in.ogv" type='video/ogg; codecs="theora, vorbis"'>
    <source src="Intermission-Walk-in_512kb.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  </video>
<audio id="audios" autoplay="autoplay" controls="controls"  autobuffer="true" width="400px" height="300px">
    <source src="Intermission-Walk-in.ogv" type='video/ogg; codecs="theora, vorbis"'>
     
  </audio>
  <canvas id="timeline" width="400px" height="300px"></canvas>
<script type="text/javascript">

     var updateInterval = 10;


   setInterval(updateFrame, updateInterval);


    function updateFrame() {
        var video = document.getElementById("movies");
        var audio = document.getElementById("audios");
            audio.addEventListener('error',function(){
                switch(audio.error.code){
                    case 1:{
                        /* 被用户终止*/
                    }
                    case 2:{
                        /*网络故障，*/
                    }
                    case 3:{
                        /*解码失败*/
                    }
                    case 4:{
                        /*不支持的格式*/

                    }
                }
            })
            audio.addEventListener('progress',function(){
                if(audio.networkState==2){
                  var  load=e.loaded/e.total;
                }
                
            })
        /*
         play();
         pause();
         load();
         canPlayType();
         只读
         duration
         buffered缓存属性，返回TimeRanges
         paused
         ended
         startTime
         error
         currentSrc
         networkState 
         读写
         autoplay
         loop
         currentTime
         controls
         volume 音量
         muted 静音
         autobuffer
         defaultPlaybackRate 读取或修改默认播放速率
         playbackRate读取或修改当前播放速率
         对于video
         poster
         width,height
         videoWidth,videoHeight
         */

        audio.playbackRate
    }




  </script>


</body>
</html>